import React from "react";
import { UserInfoType, StoreStateType } from "../../interface";
import { useSelector } from "react-redux";
import "./style.css";

const Header = () => {

  const userInfo = useSelector((state: StoreStateType) => {
    return state.PublicReducer.userInfo as UserInfoType;
  });


  return (
    <div className="box">
      <h2>宏烨找房管理后台</h2>
      <p>{userInfo.name}管理员| <a href="/Login">退出</a></p>
    </div>
  );
}



export default Header